#include "ce_core.h"
#include "ce_tester.h"

using namespace CETester;

CE_TESTCASE(Netip) {
    TestPrint("%lu", sizeof(ce_netip_t));

    ce_netip_t addr;
    
    int ret = inet_pton(AF_INET, "127.0.0.1", &addr.addr);
    TestPrint("%d", ret);
    TestPrint("%d %d %d", addr.addr.sin.sin_family, addr.addr.sin.sin_len, addr.addr.sin.sin_port);

    char ip[64];
    const char *tmp = inet_ntop(AF_INET, &addr.addr, ip, 128);
    TestPrint("%s %p", tmp, tmp);
    TestPrint("%s %p", ip, ip);
}

int main() {
    RunAllTester();
}
